package com.shuai.mapper;


import com.shuai.entity.File;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface FileMapper {

    /**
     * 批量出入口味数据
     * */
    void insertBatch(List<File> flavors);

    /**
     * 根据项目Id删除口味数据
     * */
    @Delete("delete from file where project_id  = #{projectId}")
    void deleteByFileId(Long projectId);

    /**
     * 根据项目id集合批量删除关联的口味数据
     * */
    void deleteBatch(List<Long> ids);

    @Select("select * from file where project_id = #{projectId}")
    List<File> getByProjectId(Long projectId);

    @Delete("delete from file where project_id = #{projectId}")
    void deleteByProjectId(Long projectId);
}
